home *** CD-ROM | disk | FTP | other *** search
- unit uStatusDlg;
-
- {
- *******************************************************************************
- * Descriptions: Main Unit for FMA
- * $Source: /cvsroot/fma/fma/uStatusDlg.pas,v $
- * $Locker: $
- *
- * Todo:
- *
- * Change Log:
- * $Log: uStatusDlg.pas,v $
- * Revision 1.3 2004/06/15 13:00:51 z_stoichev
- * Allow different window position usage.
- *
- * Revision 1.2 2003/12/11 14:04:44 z_stoichev
- * Removed Always on top.
- * Show as screen centered.
- *
- * Revision 1.1 2003/12/09 16:09:31 z_stoichev
- * Initial checkin.
- *
- *
- }
-
- interface
-
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, ExtCtrls;
-
- type
- TfrmStatusDlg = class(TForm)
- Image1: TImage;
- Label1: TLabel;
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- procedure Status(Msg: string);
- end;
-
- var
- frmStatusDlg: TfrmStatusDlg;
-
- function ShowStatusDlg(Msg: string; Where: TPosition = poScreenCenter): TfrmStatusDlg;
-
- implementation
-
- {$R *.dfm}
-
- function ShowStatusDlg(Msg: string; Where: TPosition): TfrmStatusDlg;
- begin
- Result := TfrmStatusDlg.Create(nil);
- with Result do begin
- Position := Where;
- Status(Msg);
- Show;
- Update;
- end;
- end;
-
- procedure TfrmStatusDlg.FormCreate(Sender: TObject);
- begin
- Image1.Picture.Icon.Assign(Application.Icon);
- end;
-
- procedure TfrmStatusDlg.Status(Msg: string);
- var
- w: integer;
- begin
- w := Label1.Width;
- Label1.Caption := Msg;
- Width := Label1.Left + Label1.Width + 32;
- if Visible then begin
- Left := Left - (Label1.Width - w) div 2;
- Update;
- end;
- end;
-
- end.
-